{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "a7836707-5dc6-4bd6-9092-e307c7c6996a",
   "metadata": {},
   "source": [
    "第一个核心概念是，宏观分布的微观态数目  \n",
    "我记得sagemath有排列组合（数论）的部分，应该可以整点东西出来  \n",
    "不过后面好像用上ln对数了……emmmm一会儿看看吧"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d72465d1-b46d-4848-8018-32330077086b",
   "metadata": {},
   "source": [
    "几个基本概念，书上概念性的，第一节之前  \n",
    "* 相同的可分辨粒子：化学结构相同的粒子，可以用同一个μ空间描写运动状态（mu是希腊文“分子”第一个字母）\n",
    "* 近独立粒子：粒子能量直接加起来作为总能量，相互之间的作用能则忽略掉了\n",
    "* 粒子按能量分布：宏观，只考虑每个相格内的粒子数\n",
    "* 系统的微观态和宏观态\n",
    "\n",
    "后面还有gamma空间（倒L，是mu空间合起来的样子"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "2b22bc42-f65c-4976-8198-d7113d745f88",
   "metadata": {},
   "outputs": [],
   "source": [
    "class MuSpace:\n",
    "    def __init__(self,G=[5,6,7,8,9]):\n",
    "        self.G=G\n",
    "\n",
    "    def W_N(self,N_list):\n",
    "        N = sum(N_list)\n",
    "        A=1\n",
    "        for N_i in N_list:\n",
    "            A*=factorial(N_i)\n",
    "        B=1\n",
    "        for i in range(len(self.G)):\n",
    "            B*= self.G[i]^N_list[i]\n",
    "        \n",
    "        # G怎么表述？什么意思？\n",
    "    \n",
    "        #排布方法数，然后是……Gi？每个粒子可以任意选择该层共Gi个相格中的任意一个\n",
    "        #好像这个Gi是在mu空间里的\n",
    "        return factorial(N)/A*B"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "e22d3f60-1a93-4e3a-ba6c-d7bb59e2c164",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1296"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a_space = MuSpace([6,6,6])\n",
    "a_space.W_N([1,1,1])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "658044d7-1680-42e8-9d33-2a170854b2d2",
   "metadata": {},
   "source": [
    "接下来是：  \n",
    "粒子按能层填充的最概然分布表达式 （能级离散情况）\n",
    "$$\n",
    "N_i^0 = \\frac{N} {Z_1}\\exp(-\\frac{\\varepsilon_i}{k_B T})G_i  \n",
    "$$\n",
    "$$\n",
    "\\quad Z_1 = \\sum_i e^{-\\beta \\varepsilon_i} G_i\n",
    "$$\n",
    "\n",
    "其物理意义是巴拉巴拉巴拉巴拉看不懂  \n",
    "好吧先看看书  \n",
    "“其物理意义是在温度为T的平衡态下，在相格数为G_i的$\\varepsilon_i$能量层按如此方式填充Ni0个粒子，则由N个粒子数组成的系统具有最多的微观状态数。其中Z1为单粒子配分函数……”  \n",
    "古典玩法：看似无关，实则得到正确结果\n",
    "\n",
    "另：这个式子书上框了一下，估计比较重要了"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "SageMath 10.5",
   "language": "sage",
   "name": "sagemath"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
